using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using SCSFContrib.CompositeUI.WPF.Workspaces;

namespace SCSFContrib.CompositeUI.WPF.UnitTest.Workspaces
{
	[TestFixture]
	public sealed class ZoneSmartPartInfoTest : UnitTest
	{
		private ZoneSmartPartInfo _zoneSmartPartInfo;

		protected override void SetUpCore()
		{
			base.SetUpCore();
			_zoneSmartPartInfo = new ZoneSmartPartInfo();
		}

		[Test]
		public void Constructor_ShouldSetDefaults()
		{
			Assert.IsNull(_zoneSmartPartInfo.ZoneName);
		}

		[Test]
		public void Constructor_ZoneName_ShouldAssignZoneName()
		{
			_zoneSmartPartInfo = new ZoneSmartPartInfo("zoneName");
			Assert.AreEqual("zoneName", _zoneSmartPartInfo.ZoneName);
		}

		[Test]
		public void Properties_ShouldGetAndSetCorrectly()
		{
			_zoneSmartPartInfo.ZoneName = "zoneName";
			Assert.AreEqual("zoneName", _zoneSmartPartInfo.ZoneName);
		}

		[Test]
		[ExpectedException(typeof(ArgumentNullException))]
		public void ApplyTo_ZoneSmartPartInfo_ShouldThrowIfZoneSmartPartInfoIsNull()
		{
			_zoneSmartPartInfo.ApplyTo((ZoneSmartPartInfo) null);
		}

		[Test]
		public void ApplyTo_ZoneSmartPartInfo_ShouldApplyPropertiesToGivenZoneSmartPartInfo()
		{
			ZoneSmartPartInfo destination = new ZoneSmartPartInfo();

			_zoneSmartPartInfo.ZoneName = "zoneName";
			_zoneSmartPartInfo.ApplyTo(destination);

			Assert.AreEqual("zoneName", destination.ZoneName);
		}
	}
}
